package com.bilin.coin.activity;

import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.bilin.coin.R;
import com.bilin.coin.bean.GoldRechargeRecordBean;
import com.bilin.coin.tools.AbsHeadRecycleViewActivity;
import com.bilin.coin.utils.GsonUtil;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Route(path = "/auction/GuaSellGoldRecordActivity")
public class GuaSellGoldRecordActivity extends AbsHeadRecycleViewActivity<GoldRechargeRecordBean.RecordsBean> {


    @Override
    protected void initView() {
        super.initView();
        setTitle("挂卖金豆记录");
    }

    @Override
    protected void convertItem(BaseViewHolder helper, GoldRechargeRecordBean.RecordsBean item) {

        helper.setText(R.id.tv_sell_num,item.getAmount());
        helper.setText(R.id.tv_sell_account,item.getUserLoginName());
        helper.setText(R.id.tv_sell_fee,item.getFee());
        helper.setText(R.id.tv_seed_num,item.getZzFee());
        helper.setText(R.id.tv_time,item.getCreateTime());
    }

    @Override
    protected int fillItemLayout() {
        return R.layout.item_gold_sell_record;
    }

    @Override
    public int fillPageSize() {
        return 10;
    }

    @Override
    public boolean isPost() {
        return false;
    }

    @Override
    public String fillUrl() {
        return "/api/bl-sell-jd-log/withdrawLog";
    }

    @Override
    protected View fillHeadView() {
        return new View(this);
    }

    @Override
    public Map<String, String> fillParams() {
        HashMap params = new HashMap();
        params.put("currentPage", page + "");
        params.put("pageSize", pageSize + "");
        return params;
    }

    @Override
    public List parseListDataAndFillTotal(String dataJson) {
        GoldRechargeRecordBean goldRechargeRecordBean = GsonUtil.GsonToBean(dataJson, GoldRechargeRecordBean.class);
        totalCount = goldRechargeRecordBean.getTotal();
        return goldRechargeRecordBean.getRecords();
    }

    @Override
    protected void refreshFragmentOrHead() {

    }
}
